package com.efuture.io;

import java.io.FileReader;
import java.util.Iterator;
import java.util.Properties;
import java.util.Set;

/**
 * @ClassNAME PropertiesIOTest
 * @Description Properties与IO联合使用
 * @Author zhaoshanshan
 * @Date 2021/9/9 2:21 上午
 * @Version 1.0
 */
public class PropertiesIOTest {

    public static void main(String[] args) {

        try{
            FileReader fr = new FileReader("javasestudy/src/com.efuture.io/propertiesiotest.txt");
            Properties properties = new Properties();
            properties.load(fr);
            Set<Object> keys = properties.keySet();
            Iterator<Object> it = keys.iterator();
            while (it.hasNext()){
                Object obj = it.next();
                System.out.println(obj+"="+properties.get(obj));
            }
            System.out.println("");

        }catch (Exception e){
            e.getStackTrace();
        }

    }
}